/* 2017/05/09 */
package org.sample.springboot.converter;

import java.lang.reflect.Field;
import java.lang.reflect.Type;

/**
 * The class <code>TypeMember</code> represents a nested target inside a type
 * might be converted.
 * 
 */
class TypeMember {

	private TypeMemberCategory category;

	private Type type;

	private Field field;

	public TypeMemberCategory getCategory() {
		return category;
	}

	public void setCategory(TypeMemberCategory category) {
		this.category = category;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public Field getField() {
		return field;
	}

	public void setField(Field field) {
		this.field = field;
	}

	@Override
	public String toString() {
		if (TypeMemberCategory.CLASS_FIELD.equals(category) && field != null) {
			return category.toString() + " " + field.getName();
		} else {
			return category.toString();
		}
	}
	
}
